<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    table {
        border: solid .0125rem;
        width: 4rem;
    }

    td {
        border: solid .0125rem;
    }
</style>
<script src="./flexible.js"></script>

<body>
    <table>
        <thead>
            <tr>
                <td>姓名</td>
                <td>成绩</td>
                <td>排名</td>

            </tr>
        </thead>
        <tbody>
            <tr>
                <td>高</td>
                <td>99</td>
                <td>1</td>
            </tr>
            <tr>
                <td>李</td>
                <td>89</td>
                <td>2</td>
            </tr>
            <tr>
                <td>王</td>
                <td>88</td>
                <td>3</td>
            </tr>
            <tr>
                <td>张</td>
                <td>77</td>
                <td>4</td>
            </tr>
            <tr>
                <td>吴</td>
                <td>60</td>
                <td>5</td>
            </tr>
        </tbody>
    </table>
    <script>
        var tbody = document.querySelector('tbody');
        var trs = tbody.querySelectorAll("tr");
        for (var i = 0; i < trs.length; i++) {
            trs[i].onmouseover = function () {
                this.style.backgroundColor = "pink";
            }
            trs[i].onmouseout = function () {
                this.style.backgroundColor = "white";
            }
        }
    </script>
</body>

</html>